import java.util.Comparator;
import java.util.Objects;

public class Worker  {

//
//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null ) return false;
//        Worker worker = (Worker) o;
//        return  workAge == worker.workAge;
//    }



    String name;
    int age;

    int workAge;

//    @Override
//    public int compareTo(Object o) {
//        if (this == o) return 0;
//        if (o == null ) return -1;
//        Worker worker = (Worker) o;
//        return  workAge - worker.workAge;
//    }




    public static void main(String[] args) {

        ComWorker c=new ComWorker();

        Worker t=new Worker();
        Worker t1=new Worker();
        Worker t2=new Worker();
        t.age=19;
        t.name="aaa";
        t.workAge=3;

        t1.age=19;
        t1.name="aaa";
        t1.workAge=2;

        t2.age=22;
        t2.name="ccc";
        t2.workAge=3;


        int n= c.compare(t,t1);

      if(n>0){
          System.out.println("大于");
      }else if(n<0){
          System.out.println("小于");
      }else {
          System.out.println("相等");

      }

    }


}

 class ComWorker implements Comparator {


     @Override
     public int compare(Object o1, Object o2) {
         if (o1==o2) return 0;

         Worker worke1 = (Worker) o1;
         Worker worker2 = (Worker) o2;
         return worke1.workAge-worker2.workAge;
     }
 }


